package com.bstek.bdf2.core.mq.publisher;



import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * @Title: 发送消息对象
 * @Package: mq.config.api
 * @Description:
 * @Author: zxq
 * @Date: 2024/1/29 - 14:35
 */


public class MessageInfo implements Serializable {
    /* 	消息的唯一ID	*/
    private String messageId;

    /*	消息的主题		*/


    private String topic;

    /*	消息的路由规则或者队列名称	*/

    private String routingKey;

    /*	交换机名称	*/

    private String exchangeName;

    /*	消息的附加属性	*/
    private Map<String, Object> attributes = new HashMap<String, Object>();

    /*	延迟消息的参数配置	*/
    private int delayMills;

    /*	具体消息信息	*/
    private Object message;

    public MessageInfo() {

    }
    public MessageInfo(String messageId, String topic, String routingKey, Map<String, Object> attributes, int delayMills) {
        this.messageId = messageId;
        this.topic = topic;
        this.routingKey = routingKey;
        this.attributes = attributes;
        this.delayMills = delayMills;
    }

    public String getMessageId() {
        return messageId;
    }

    public void setMessageId(String messageId) {
        this.messageId = messageId;
    }

    public String getTopic() {
        return topic;
    }

    public void setTopic(String topic) {
        this.topic = topic;
    }

    public String getRoutingKey() {
        return routingKey;
    }

    public void setRoutingKey(String routingKey) {
        this.routingKey = routingKey;
    }

    public String getExchangeName() {
        return exchangeName;
    }

    public void setExchangeName(String exchangeName) {
        this.exchangeName = exchangeName;
    }

    public Map<String, Object> getAttributes() {
        return attributes;
    }

    public void setAttributes(Map<String, Object> attributes) {
        this.attributes = attributes;
    }

    public int getDelayMills() {
        return delayMills;
    }

    public void setDelayMills(int delayMills) {
        this.delayMills = delayMills;
    }

    public Object getMessage() {
        return message;
    }

    public void setMessage(Object message) {
        this.message = message;
    }

    @Override
    public String toString() {
        return "MessageInfo{" +
                "messageId='" + messageId + '\'' +
                ", topic='" + topic + '\'' +
                ", routingKey='" + routingKey + '\'' +
                ", exchangeName='" + exchangeName + '\'' +
                ", attributes=" + attributes +
                ", delayMills=" + delayMills +
                ", message=" + message +
                '}';
    }
}